import Layout from '@/views/layout'
import Layout2 from '@/views/layout/index2'

const permissionRouter = {
  path: '/permissionManagement',
  component: Layout2,
  redirect: 'noredirect',
  name: 'permissionManagement',
  needAuth: true,
  meta: { title: '权限管理', icon: 'jurisdiction-icon' },
  children: [
    {
      path: '/roleManage',
      component: Layout,
      meta: { title: '角色管理', noCache: true, breadcrumb: false },
      redirect: '/roleManage/index',
      name: 'roleManage',
      needAuth: true,
      children: [{
        path: 'index',
        name: 'roleIndex',
        component: () => import('@/views/roleManage/index'),
        meta: { title: '角色管理', noCache: true },
      },
      {
        path: 'permission',
        name: 'permission',
        component: () => import('@/views/roleManage/permission'),
        meta: { title: '权限设置', noCache: true, activeMenu: '/roleManage/index' },
        hidden:true
      }]
    },
    {
      path: '/userManage',
      component: Layout,
      meta: { title: '成员管理', breadcrumb: false },
      redirect: '/userManage/index',
      name: 'userManage',
      needAuth: true,
      children: [{
        path: 'index',
        name: 'userManageIndex',
        component: () => import('@/views/userManage/index'),
        meta: { title: '成员管理', noCache: true }
      },
      {
        path: 'add',
        name: 'userManageAdd',
        component: () => import('@/views/userManage/add'),
        meta: { title: '添加成员', activeMenu: '/userManage/index'},
        hidden: true
      },
      {
        path: 'edit',
        name: 'userManageEdit',
        component: () => import('@/views/userManage/add'),
        meta: { title: '编辑成员', activeMenu: '/userManage/index' },
        hidden: true
      }]
    }
  ]
}

export default permissionRouter